package collections.g1;

import java.util.HashMap;
import java.util.Map;

public class VersicherungsKunde {
	
	private static Map<Character, Double> map 
	= new HashMap<Character, Double>();
	
	// statischer Init-Block:
	static{
		map.put(new Character('A'), new Double("50.2"));
		map.put(new Character('B'), new Double("64.1"));
		map.put(new Character('C'), new Double("64.9"));
		map.put(new Character('D'), new Double("99.9"));
	}

	private String name;
	private int alter;
	private double beitrag;

	public VersicherungsKunde(String name, int alter, char risikoFaktor) {
		setName(name);
		setAlter(alter);
		setBeitrag(map.get(new Character(risikoFaktor)));
	}

	private void setName(String name) {
		this.name = name;
	}

	private void setAlter(int alter) {
		this.alter = alter;
	}

	private void setBeitrag(double beitrag) {
		this.beitrag = beitrag;
	}

	public String getName() {
		return name;
	}

	public int getAlter() {
		return alter;
	}

	public double getBeitrag() {
		return beitrag;
	}
}
